var should = require('chai').should();
var webdriver = require('selenium-webdriver');
var By = webdriver.By;

var builder = new webdriver.Builder().usingServer("http://127.0.0.1:4444/wd/hub");
 builder.withCapabilities({ browserName : "chrome" });
 var driver = builder.build();

describe ('搜索功能测试', function () {
  beforeEach(function () {
      driver.get("http://47.95.218.7:3000/mine");
     });
      afterEach(function () {
        driver.close();
        driver.quit();
      });
     it('个人页面切换', function (done) {

       driver.findElement(By.xpath("//ul[@id='reslist']/li[2]")).click();
       driver.findElement(By.linkText("历史上传")).click();
       driver.findElement(By.linkText("浏览记录")).click();
       driver.findElement(By.linkText("历史下载")).click();
       driver.findElement(By.xpath("//ul[@id='reslist']/li")).click();
       driver.findElement(By.id("nextPage")).click();
       driver.findElement(By.id("c_n6")).click();
       driver.findElement(By.xpath("//body")).click();
       driver.findElement(By.linkText("资源广场")).click();
       driver.findElement(By.xpath("//div[@id='top']/ul/li[7]/a/b")).click();
       driver.findElement(By.id("c_n6")).click();
            done();
     });
 });
